<!doctype html>
<html class="default no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Notification | React Native Background Geolocation</title>
	<meta name="description" content="Documentation for React Native Background Geolocation">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">
	<link rel="shortcut icon" class="favicon" href="../assets/images/favicon.ico">
	<script src="../assets/js/search.js"></script>
</head>
<body>
<header>
	<div class="tsd-page-toolbar">
		<div class="container">
			<div class="table-wrap">
				<div class="table-cell left">
					<div class="brand">
						<a class="logo" href="https://www.transistorsoft.com"><img src="../assets/images/transistor-logo-bw.svg" /></a>
						<span class="title">
							<a href="/react-native-background-geolocation">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 4.18.0</span>
						</span>
					</div>
				</div>
				<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
					<div class="field">
						<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
						<input id="tsd-search-field" type="text" />
					</div>
					<ul class="results">
						<li class="state loading"></li>
						<li class="state failure">The search index is not available</li>
					</ul>
				</div>
				<div class="table-cell" id="tsd-widgets">
					<div id="tsd-filter">
						<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
						<div class="tsd-filter-group">
							<div class="tsd-select" id="tsd-filter-visibility">
								<span class="tsd-select-label">All</span>
								<ul class="tsd-select-list">
									<li data-value="public">Public</li>
									<li data-value="protected">Public/Protected</li>
									<li data-value="private" class="selected">All</li>
								</ul>
							</div>
							<input type="checkbox" id="tsd-filter-inherited" checked />
							<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
						</div>
					</div>
					<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
				</div>
			</div>
		</div>
	</div>
	<div class="tsd-page-title">
		<div class="container">
			<ul class="tsd-breadcrumb">
				<li>
					<a href="../index.html">React Native Background Geolocation</a>
				</li>
				<li>
					<a href="notification.html">Notification</a>
				</li>
			</ul>
			<h1>Interface Notification</h1>
		</div>
	</div>
</header>
<div class="container container-main">
	<div class="row">
		<div class="col-9 col-content">
			<section class="tsd-panel tsd-comment">
				<div class="tsd-comment tsd-typography">
					<div class="lead">
						<p><strong>[Android only]</strong> The Android operating system requires a persistent notification when running a foreground service.</p>
					</div>
					<p><img src="https://dl.dropbox.com/s/acuhy5cu4p7uofr/android-foreground-service-default.png?dl=1" alt=""></p>
					<dl class="tsd-comment-tags">
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-typescript"><span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    title: </span><span style="color: #E6DB74">&quot;The Title&quot;</span><span style="color: #F8F8F2">,</span>
<span style="color: #F8F8F2">    text: </span><span style="color: #E6DB74">&quot;The Text&quot;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">})</span>
<span style="color: #F8F8F2">.</span>
<span style="color: #F8F8F2">.</span>
<span style="color: #F8F8F2">.</span>
<span style="color: #88846F">// To update the notification in real-time, use #setConfig</span>
<span style="color: #88846F">// You need only provide *changed* parameters --  initially configured</span>
<span style="color: #88846F">// parameters will remain unchanged.</span>
<span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">setConfig</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    title: </span><span style="color: #E6DB74">&quot;The New Title&quot;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">})</span>
</code></pre>
							<a href="#custom-notification-layouts" id="custom-notification-layouts" style="color: inherit; text-decoration: none;">
								<h2>Custom Notification Layouts</h2>
							</a>
							<p>Use the <a href="notification.html#layout">layout</a> option to provide the name of your own Android Layout XML File.  See <a href="https://github.com/transistorsoft/react-native-background-geolocation/wiki/Android-Custom-Notification-Layout">Android Custom Notification Layout</a> for setup instructions.</p>
						</dd>
					</dl>
				</div>
			</section>
			<section class="tsd-panel tsd-hierarchy">
				<h3>Hierarchy</h3>
				<ul class="tsd-hierarchy">
					<li>
						<span class="target">Notification</span>
					</li>
				</ul>
			</section>
			<section class="tsd-panel-group tsd-index-group">
				<h2>Index</h2>
				<section class="tsd-panel tsd-index-panel">
					<div class="tsd-index-content">
						<section class="tsd-index-section ">
							<h3>Properties</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#actions" class="tsd-kind-icon">actions</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#channelid" class="tsd-kind-icon">channel<wbr>Id</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#channelname" class="tsd-kind-icon">channel<wbr>Name</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#color" class="tsd-kind-icon">color</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#largeicon" class="tsd-kind-icon">large<wbr>Icon</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#layout" class="tsd-kind-icon">layout</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#priority" class="tsd-kind-icon">priority</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#smallicon" class="tsd-kind-icon">small<wbr>Icon</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#sticky" class="tsd-kind-icon">sticky</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#strings" class="tsd-kind-icon">strings</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#text" class="tsd-kind-icon">text</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface"><a href="notification.html#title" class="tsd-kind-icon">title</a></li>
							</ul>
						</section>
					</div>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Properties</h2>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="actions" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> actions</h3>
					<div class="tsd-signature tsd-kind-icon">actions<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Object</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Declare click listeners for <code>&lt;Button /&gt;</code> elements of a custom notification <a href="notification.html#layout">layout</a>.</p>
						</div>
						<p><img src="https://dl.dropbox.com/s/whcb6q1gxxdk9t1/android-foreground-notification-transistor.png?dl=1" alt=""></p>
						<p>ℹ️ See <a href="https://github.com/transistorsoft/react-native-background-geolocation/wiki/Android-Custom-Notification-Layout">Android Custom Notification Layout</a> for setup instructions.</p>
						<p>You can declare your own custom <code>&lt;Button /&gt;</code> elements and register click-listeners upon them using the <a href="notification.html#actions">actions</a> parameter:</p>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-xml"><span style="color: #F8F8F2">&lt;</span><span style="color: #F92672">Button</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/notificationButtonPause&quot;</span><span style="color: #F8F8F2"> // &lt;-- notificationButtonPause</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">style</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@style/Widget.AppCompat.Button.Small&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;60dp&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;40dp&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:text</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;Foo&quot;</span><span style="color: #F8F8F2"> /&gt;</span>
</code></pre>
								<p>Register listeners for your button using <code>notification.actions</code>:</p>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    actions: [  </span><span style="color: #88846F">// &lt;-- register button listeners</span>
<span style="color: #F8F8F2">      </span><span style="color: #E6DB74">&quot;notificationButtonPause&quot;</span>
<span style="color: #F8F8F2">    ]</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>

<span style="color: #88846F">// Listen to custom button clicks:</span>
<span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">onNotificationAction</span><span style="color: #F8F8F2">((</span><span style="color: #FD971F">buttonId</span><span style="color: #F8F8F2">) </span><span style="color: #66D9EF">=&gt;</span><span style="color: #F8F8F2"> {</span>
<span style="color: #F8F8F2">  console.</span><span style="color: #A6E22E">log</span><span style="color: #F8F8F2">(</span><span style="color: #E6DB74">&quot;[onNotificationAction] - &quot;</span><span style="color: #F8F8F2">, buttonId);</span>
<span style="color: #F8F8F2">  </span><span style="color: #F92672">switch</span><span style="color: #F8F8F2">(buttonId) {</span>
<span style="color: #F8F8F2">    </span><span style="color: #F92672">case</span><span style="color: #F8F8F2"> </span><span style="color: #E6DB74">&quot;notificationButtonPause&quot;</span><span style="color: #F8F8F2">:</span>
<span style="color: #F8F8F2">      BackgroundGeolocation.</span><span style="color: #A6E22E">changePace</span><span style="color: #F8F8F2">(</span><span style="color: #AE81FF">false</span><span style="color: #F8F8F2">);</span>
<span style="color: #F8F8F2">      </span><span style="color: #F92672">break</span><span style="color: #F8F8F2">;</span>
<span style="color: #F8F8F2">    .</span>
<span style="color: #F8F8F2">    .</span>
<span style="color: #F8F8F2">    .</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
							</dd>
						</dl>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="channelid" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> channel<wbr>Id</h3>
					<div class="tsd-signature tsd-kind-icon">channel<wbr>Id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Customize the notification channel ID.
							Defaults to <code>your.package.name.TSLocationManager</code></p>
						</div>
						<p><strong>NOTE</strong>:  It is not typically required to change this.  Typical use-cases are for users who use an existing Android foreground-service who wish the SDK to share an existing notification and channel.</p>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="channelname" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> channel<wbr>Name</h3>
					<div class="tsd-signature tsd-kind-icon">channel<wbr>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Configure the name of the plugin&#39;s notification-channel used to display the <a href="config.html#foregroundservice">Config.foregroundService</a> notification.</p>
						</div>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-break">break</dt>
							<dd><p>On Android O+, the plugin&#39;s foreground-service needs to create a &quot;Notification Channel&quot;.  The name of this channel can be seen in:</p>
								<blockquote>
									<p><code>Settings-&gt;App &amp; Notifications-&gt;Your App.</code></p>
								</blockquote>
								<p>Defaults to your application&#39;s name from <code>AndroidManifest</code>.</p>
								<p><img src="https://dl.dropboxusercontent.com/s/zgcxau7lyjfuaw9/android-notificationChannelName.png?dl=1" alt="">\</p>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    channelName: </span><span style="color: #E6DB74">&quot;Location Tracker&quot;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>

<span style="color: #88846F">// or with #setConfig</span>
<span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">setConfig</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    channelName: </span><span style="color: #E6DB74">&quot;My new channel name&quot;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
							</dd>
						</dl>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="color" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> color</h3>
					<div class="tsd-signature tsd-kind-icon">color<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Configure the <em>color</em> of the persistent notification icon in the Notification Bar when running with <a href="config.html#foregroundservice">Config.foregroundService</a> <strong><code>true</code></strong></p>
						</div>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-break">break</dt>
							<dd><p>Defaults to <code>null</code>.  When running the service with <a href="config.html#foregroundservice">Config.foregroundService</a>: true, Android requires a persistent notification.  This will configure the <strong>color</strong> of the notification <strong>icon</strong> (API &gt;= 21).</p>
								<p>Supported formats are:</p>
								<ul>
									<li><code>#RRGGBB</code></li>
									<li><code>#AARRGGBB</code></li>
								</ul>
							</dd>
						</dl>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="largeicon" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> large<wbr>Icon</h3>
					<div class="tsd-signature tsd-kind-icon">large<wbr>Icon<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Configure the <em>large icon</em> of the persistent notification in the Notification Bar when running with <a href="config.html#foregroundservice">Config.foregroundService</a> <strong><code>true</code></strong></p>
						</div>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-break">break</dt>
							<dd><p>When running the service with <a href="config.html#foregroundservice">Config.foregroundService</a>: true, Android requires a persistent notification in the Notification Bar.  This allows you customize that icon.  Defaults to your application icon.</p>
								<a href="#⚠️-warning" id="⚠️-warning" style="color: inherit; text-decoration: none;">
									<h3>⚠️ Warning:</h3>
								</a>
								<ul>
									<li>You must specify the <strong><code>type</code></strong> (<code>drawable|mipmap</code>) of resource you wish to use in the following format: <code>{type}/icon_name</code></li>
									<li>Do not append the file-extension (eg: <code>.png</code>)</li>
								</ul>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #88846F">// 1. drawable</span>
<span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    smallIcon: </span><span style="color: #E6DB74">&quot;drawable/my_custom_notification_small_icon&quot;</span>
<span style="color: #F8F8F2">});</span>

<span style="color: #88846F">// 2. mipmap</span>
<span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    smallIcon: </span><span style="color: #E6DB74">&quot;mipmap/my_custom_notification_small_icon&quot;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
								<a href="#ℹ️-see-also" id="ℹ️-see-also" style="color: inherit; text-decoration: none;">
									<h3>ℹ️ See also:</h3>
								</a>
								<ul>
									<li><a href="notification.html#smallicon">smallIcon</a></li>
								</ul>
							</dd>
						</dl>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="layout" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> layout</h3>
					<div class="tsd-signature tsd-kind-icon">layout<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Specifies the name of your custom Android Layout XML file.</p>
						</div>
						<p>ℹ️ See <a href="https://github.com/transistorsoft/react-native-background-geolocation/wiki/Android-Custom-Notification-Layout">Android Custom Notification Layout</a> for setup instructions.</p>
						<p><img src="https://dl.dropbox.com/s/whcb6q1gxxdk9t1/android-foreground-notification-transistor.png?dl=1" alt=""></p>
						<p>Even if you have no experience with Android Layouts, it doesn&#39;t take much to figure out the basics.  You&#39;ll mostly be adding <code>&lt;TextView /&gt;</code>, <code>&lt;ImageView /&gt;</code> and <code>&lt;Button /&gt;</code> elements.  The key thing to be aware of is the <code>android:id</code> of these elements and how these are referenced from <code>BackgroundGeolocation.notification</code> configuration:  your <code>android:id</code> <strong>must</strong> be prefixed with the word <code>notification</code> (eg: <code>notificationText</code>).  There is one exception: <code>applicationName</code>, which the plugin will automatically render your Android application name.</p>
						<a href="#layout-special-elements" id="layout-special-elements" style="color: inherit; text-decoration: none;">
							<h3>Layout Special Elements</h3>
						</a>
						<p>When BackgroundGeolocation renders your custom notification layout, it will be querying for the following elements addressed by their <code>android:id</code>.  When found, their content will be updated from the corresponding &quot;Data-source&quot;:</p>
						<table>
							<thead>
								<tr>
									<th>Layout element <code>android:id</code></th>
									<th>Data-source</th>
								</tr>
							</thead>
							<tbody><tr>
									<td><code>applicationName</code></td>
									<td><em>Application name</em> from <code>AndroidManifest</code></td>
								</tr>
								<tr>
									<td><code>notificationTitle</code></td>
									<td><a href="notification.html#title">title</a></td>
								</tr>
								<tr>
									<td><code>notificationText</code></td>
									<td><a href="notification.html#text">text</a></td>
								</tr>
								<tr>
									<td><code>notificationSmallIcon</code></td>
									<td><a href="notification.html#smallicon">smallIcon</a></td>
								</tr>
								<tr>
									<td><code>notificationLargeIcon</code></td>
									<td><a href="notification.html#largeicon">largeIcon</a></td>
								</tr>
						</tbody></table>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    layout: </span><span style="color: #E6DB74">&quot;my_notification_layout&quot;</span><span style="color: #F8F8F2">,  </span><span style="color: #88846F">// &lt;-- custom layout xml file</span>
<span style="color: #F8F8F2">    title: </span><span style="color: #E6DB74">&quot;The Notification Title&quot;</span><span style="color: #F8F8F2">,</span>
<span style="color: #F8F8F2">    text: </span><span style="color: #E6DB74">&quot;The Notification Text&quot;</span><span style="color: #F8F8F2">,</span>
<span style="color: #F8F8F2">    smallIcon: </span><span style="color: #E6DB74">&quot;mipmap/my_small_icon&quot;</span><span style="color: #F8F8F2">, </span><span style="color: #88846F">// &lt;-- defaults to app icon</span>
<span style="color: #F8F8F2">    largeIcon: </span><span style="color: #E6DB74">&quot;mipmap/my_large_icon&quot;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
								<a href="#custom-lttextview-gt-elements" id="custom-lttextview-gt-elements" style="color: inherit; text-decoration: none;">
									<h3>Custom <code>&lt;TextView /&gt;</code> Elements</h3>
								</a>
								<p>You can declare your own custom <code>&lt;TextView /&gt;</code> elements and render data into them using the <a href="notification.html#strings">strings</a> parameter.</p>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-xml"><span style="color: #F8F8F2">&lt;</span><span style="color: #F92672">TextView</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/myCustomElement&quot;</span><span style="color: #F8F8F2">  // &lt;-- myCustomElement</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;match_parent&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;wrap_content&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:text</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;notificationTitle&quot;</span><span style="color: #F8F8F2"> /&gt;</span>
</code></pre>
								<p>You can provide data to your custom elements using the <a href="notification.html#strings">strings</a> configuration parameter:</p>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    strings: {</span>
<span style="color: #F8F8F2">      myCustomElement: </span><span style="color: #E6DB74">&quot;My Custom Element Text&quot;</span>
<span style="color: #F8F8F2">    }</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
								<a href="#custom-ltbutton-gt-elements" id="custom-ltbutton-gt-elements" style="color: inherit; text-decoration: none;">
									<h3>Custom <code>&lt;Button /&gt;</code> Elements:</h3>
								</a>
								<p>You can declare your own custom <code>&lt;Button /&gt;</code> elements and register click-listeners upon them using the <a href="notification.html#actions">actions</a> parameter:</p>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-xml"><span style="color: #F8F8F2">&lt;</span><span style="color: #F92672">Button</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/notificationButtonFoo&quot;</span><span style="color: #F8F8F2"> // &lt;-- notificationButtonFoo</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">style</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@style/Widget.AppCompat.Button.Small&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;60dp&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;40dp&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:text</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;Foo&quot;</span><span style="color: #F8F8F2"> /&gt;</span>
</code></pre>
								<p>Register listeners for your button using the <a href="notification.html#actions">actions</a> parameter:</p>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    actions: [  </span><span style="color: #88846F">// &lt;-- register button listeners</span>
<span style="color: #F8F8F2">      </span><span style="color: #E6DB74">&quot;notificationButtonFoo&quot;</span><span style="color: #F8F8F2">,</span>
<span style="color: #F8F8F2">      </span><span style="color: #E6DB74">&quot;notificationButtonBar&quot;</span>
<span style="color: #F8F8F2">    ]</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>

<span style="color: #88846F">// Listen to custom button clicks:</span>
<span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">onNotificationAction</span><span style="color: #F8F8F2">((</span><span style="color: #FD971F">buttonId</span><span style="color: #F8F8F2">) </span><span style="color: #66D9EF">=&gt;</span><span style="color: #F8F8F2"> {</span>
<span style="color: #F8F8F2">  console.</span><span style="color: #A6E22E">log</span><span style="color: #F8F8F2">(</span><span style="color: #E6DB74">&quot;[onNotificationAction] - &quot;</span><span style="color: #F8F8F2">, buttonId);</span>
<span style="color: #F8F8F2">  </span><span style="color: #F92672">switch</span><span style="color: #F8F8F2">(buttonId) {</span>
<span style="color: #F8F8F2">    </span><span style="color: #F92672">case</span><span style="color: #F8F8F2"> </span><span style="color: #E6DB74">&quot;notificationButtonFoo&quot;</span><span style="color: #F8F8F2">:</span>
<span style="color: #F8F8F2">      </span><span style="color: #F92672">break</span><span style="color: #F8F8F2">;</span>
<span style="color: #F8F8F2">    </span><span style="color: #F92672">case</span><span style="color: #F8F8F2"> </span><span style="color: #E6DB74">&quot;notificationButtonBar&#039;</span><span style="color: #F44747">:</span>
<span style="color: #F8F8F2">      break;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
								<a href="#sample-layout" id="sample-layout" style="color: inherit; text-decoration: none;">
									<h3>Sample Layout</h3>
								</a>
								<p>As a starting-point for your custom layout, copy the following content into your new file:</p>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-xml"><span style="color: #F8F8F2">&lt;?</span><span style="color: #F92672">xml</span><span style="color: #A6E22E"> version</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;1.0&quot;</span><span style="color: #A6E22E"> encoding</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;utf-8&quot;</span><span style="color: #F8F8F2">?&gt;</span>
<span style="color: #F8F8F2">&lt;</span><span style="color: #F92672">LinearLayout</span><span style="color: #F8F8F2"> </span><span style="color: #A6E22E">xmlns:android</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;http://schemas.android.com/apk/res/android&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">xmlns:tools</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;http://schemas.android.com/tools&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;match_parent&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;135dp&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:gravity</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;start&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:adjustViewBounds</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;true&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:orientation</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;vertical&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:padding</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;15dp&quot;</span><span style="color: #F8F8F2">&gt;</span>

<span style="color: #F8F8F2">    &lt;</span><span style="color: #F92672">LinearLayout</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;match_parent&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;wrap_content&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_marginBottom</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;15dp&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:gravity</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;center&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:orientation</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;horizontal&quot;</span><span style="color: #F8F8F2">&gt;</span>

<span style="color: #F8F8F2">        &lt;</span><span style="color: #F92672">ImageView</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/notificationSmallIcon&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;16dp&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;16dp&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:tint</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@android:color/background_dark&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">tools:srcCompat</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@tools:sample/avatars&quot;</span><span style="color: #F8F8F2"> /&gt;</span>

<span style="color: #F8F8F2">        &lt;</span><span style="color: #F92672">TextView</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/applicationName&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;match_parent&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;match_parent&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:paddingLeft</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;10dp&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:text</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;applicationName&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:textAppearance</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@style/TextAppearance.Compat.Notification.Title&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:textColor</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;#888888&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:textSize</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;12sp&quot;</span><span style="color: #F8F8F2"> /&gt;</span>
<span style="color: #F8F8F2">    &lt;/</span><span style="color: #F92672">LinearLayout</span><span style="color: #F8F8F2">&gt;</span>

<span style="color: #F8F8F2">    &lt;</span><span style="color: #F92672">TextView</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/notificationTitle&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">style</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@style/TextAppearance.Compat.Notification.Title&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;match_parent&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;wrap_content&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:text</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;notificationTitle&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:textSize</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;14sp&quot;</span><span style="color: #F8F8F2"> /&gt;</span>

<span style="color: #F8F8F2">    &lt;</span><span style="color: #F92672">TextView</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/notificationText&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">style</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@style/TextAppearance.Compat.Notification.Line2&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;match_parent&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;wrap_content&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:text</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;notificationText&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:textSize</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;14sp&quot;</span><span style="color: #F8F8F2"> /&gt;</span>

<span style="color: #F8F8F2">    &lt;</span><span style="color: #F92672">LinearLayout</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;match_parent&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;wrap_content&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:layout_weight</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;1&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:gravity</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;right&quot;</span>
<span style="color: #F8F8F2">        </span><span style="color: #A6E22E">android:orientation</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;horizontal&quot;</span><span style="color: #F8F8F2">&gt;</span>

<span style="color: #F8F8F2">        &lt;</span><span style="color: #F92672">Button</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/notificationButtonFoo&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">style</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@style/Widget.AppCompat.Button.Small&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;60dp&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;40dp&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:text</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;FooA&quot;</span><span style="color: #F8F8F2"> /&gt;</span>

<span style="color: #F8F8F2">        &lt;</span><span style="color: #F92672">Button</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/notificationButtonBar&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">style</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@style/Widget.AppCompat.Button.Small&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;60dp&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;40dp&quot;</span>
<span style="color: #F8F8F2">            </span><span style="color: #A6E22E">android:text</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;Bar&quot;</span><span style="color: #F8F8F2"> /&gt;</span>
<span style="color: #F8F8F2">    &lt;/</span><span style="color: #F92672">LinearLayout</span><span style="color: #F8F8F2">&gt;</span>
<span style="color: #F8F8F2">&lt;/</span><span style="color: #F92672">LinearLayout</span><span style="color: #F8F8F2">&gt;</span>
</code></pre>
								<p><img src="https://dl.dropbox.com/s/k2l0oaqk86axfgu/android-custom-layout-elements.png?dl=1" alt=""></p>
								<a href="#using-your-custom-layout" id="using-your-custom-layout" style="color: inherit; text-decoration: none;">
									<h3>Using your custom layout:</h3>
								</a>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    title: </span><span style="color: #E6DB74">&quot;The title&quot;</span><span style="color: #F8F8F2">,</span>
<span style="color: #F8F8F2">    text: </span><span style="color: #E6DB74">&quot;The text&quot;</span><span style="color: #F8F8F2">,</span>
<span style="color: #F8F8F2">    layout: </span><span style="color: #E6DB74">&quot;notification_layout&quot;</span><span style="color: #F8F8F2">,</span>
<span style="color: #F8F8F2">    actions: [</span>
<span style="color: #F8F8F2">      </span><span style="color: #E6DB74">&quot;notificationButtonFoo&quot;</span><span style="color: #F8F8F2">,  </span><span style="color: #88846F">// &lt;-- register button click-listeners</span>
<span style="color: #F8F8F2">      </span><span style="color: #E6DB74">&quot;notificationButtonBar&quot;</span>
<span style="color: #F8F8F2">    ],</span>
<span style="color: #F8F8F2">    strings: {</span>
<span style="color: #F8F8F2">      </span><span style="color: #E6DB74">&quot;myCustomTextBox1&quot;</span><span style="color: #F8F8F2">: </span><span style="color: #E6DB74">&quot;custom TextBox element&quot;</span>
<span style="color: #F8F8F2">    }</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>

<span style="color: #88846F">// Listen to custom notification button clicks (notification.actions)</span>
<span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">onNotificationAction</span><span style="color: #F8F8F2">((</span><span style="color: #FD971F">buttonId</span><span style="color: #F8F8F2">) </span><span style="color: #66D9EF">=&gt;</span><span style="color: #F8F8F2"> {</span>
<span style="color: #F8F8F2">  console.</span><span style="color: #A6E22E">log</span><span style="color: #F8F8F2">(</span><span style="color: #E6DB74">&quot;[onNotificationAction] - &quot;</span><span style="color: #F8F8F2">, buttonId);</span>
<span style="color: #F8F8F2">  </span><span style="color: #F92672">switch</span><span style="color: #F8F8F2">(buttonId) {</span>
<span style="color: #F8F8F2">    </span><span style="color: #F92672">case</span><span style="color: #F8F8F2"> </span><span style="color: #E6DB74">&quot;notificationButtonFoo&quot;</span><span style="color: #F8F8F2">:</span>
<span style="color: #F8F8F2">      </span><span style="color: #88846F">// Handle button click on [Foo]</span>
<span style="color: #F8F8F2">      </span><span style="color: #F92672">break</span><span style="color: #F8F8F2">;</span>
<span style="color: #F8F8F2">    </span><span style="color: #F92672">case</span><span style="color: #F8F8F2"> </span><span style="color: #E6DB74">&quot;notificationButtonBar&quot;</span><span style="color: #F8F8F2">:</span>
<span style="color: #F8F8F2">      </span><span style="color: #88846F">// Handle button click on [Bar]</span>
<span style="color: #F8F8F2">      </span><span style="color: #F92672">break</span><span style="color: #F8F8F2">;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
							</dd>
						</dl>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="priority" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> priority</h3>
					<div class="tsd-signature tsd-kind-icon">priority<span class="tsd-signature-symbol">:</span> <a href="../index.html#notificationpriority" class="tsd-signature-type" data-tsd-kind="Type alias">NotificationPriority</a></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>When running the service with <a href="config.html#foregroundservice">foregroundService</a>: true, Android requires a persistent notification in the Notification Bar.  This will control the <strong>priority</strong> of that notification as well as the position of the notificaiton-bar icon.</p>
						</div>
						<p>The following <code>notificationPriority</code> values defined as static constants upon the <a href="../classes/backgroundgeolocation.html">BackgroundGeolocation</a> object:</p>
						<table>
							<thead>
								<tr>
									<th>Value</th>
									<th>Description</th>
								</tr>
							</thead>
							<tbody><tr>
									<td><a href="../classes/backgroundgeolocation.html#notification_priority_default">BackgroundGeolocation.NOTIFICATION_PRIORITY_DEFAULT</a></td>
									<td>Notification weighted to top of list; notification-bar icon weighted left</td>
								</tr>
								<tr>
									<td><a href="../classes/backgroundgeolocation.html#notification_priority_high">BackgroundGeolocation.NOTIFICATION_PRIORITY_HIGH</a></td>
									<td>Notification <strong>strongly</strong> weighted to top of list; notification-bar icon <strong>strongly</strong> weighted to left</td>
								</tr>
								<tr>
									<td><a href="../classes/backgroundgeolocation.html#notification_priority_low">BackgroundGeolocation.NOTIFICATION_PRIORITY_LOW</a></td>
									<td>Notification weighted to bottom of list; notification-bar icon weighted right</td>
								</tr>
								<tr>
									<td><a href="../classes/backgroundgeolocation.html#notification_priority_max">BackgroundGeolocation.NOTIFICATION_PRIORITY_MAX</a></td>
									<td>Same as <code>NOTIFICATION_PRIORITY_HIGH</code></td>
								</tr>
								<tr>
									<td><a href="../classes/backgroundgeolocation.html#notification_priority_min">BackgroundGeolocation.NOTIFICATION_PRIORITY_MIN</a></td>
									<td>Notification <strong>strongly</strong> weighted to bottom of list; notification-bar icon <strong>hidden</strong></td>
								</tr>
						</tbody></table>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  foregroundService: </span><span style="color: #AE81FF">true</span><span style="color: #F8F8F2">,</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    priority: BackgroundGeolocation.NOTIFICATION_PRIORITY_MIN</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
							</dd>
						</dl>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="smallicon" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> small<wbr>Icon</h3>
					<div class="tsd-signature tsd-kind-icon">small<wbr>Icon<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Configure the <em>small icon</em> of the persistent notification in the Notification Bar when running with <a href="config.html#foregroundservice">Config.foregroundService</a> <strong><code>true</code></strong></p>
						</div>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-break">break</dt>
							<dd><p>When running the service with <a href="config.html#foregroundservice">Config.foregroundService</a>: true, Android requires a persistent notification in the Notification Bar.  This allows you customize that icon.  Defaults to your application icon.</p>
								<a href="#⚠️-warning" id="⚠️-warning" style="color: inherit; text-decoration: none;">
									<h3>⚠️ Warning:</h3>
								</a>
								<ul>
									<li>You must specify the <strong><code>type</code></strong> (<code>drawable|mipmap</code>) of resource you wish to use in the following format: <code>{type}/icon_name</code></li>
									<li>Do not append the file-extension (eg: <code>.png</code>)</li>
								</ul>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #88846F">// 1. drawable</span>
<span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    smallIcon: </span><span style="color: #E6DB74">&quot;drawable/my_custom_notification_small_icon&quot;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>

<span style="color: #88846F">// 2. mipmap</span>
<span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    smallIcon: </span><span style="color: #E6DB74">&quot;mipmap/my_custom_notification_small_icon&quot;</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
								<a href="#ℹ️-see-also" id="ℹ️-see-also" style="color: inherit; text-decoration: none;">
									<h3>ℹ️ See also:</h3>
								</a>
								<ul>
									<li><a href="notification.html#largeicon">largeIcon</a></li>
								</ul>
							</dd>
						</dl>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="sticky" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> sticky</h3>
					<div class="tsd-signature tsd-kind-icon">sticky<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Configure the Android Foreground Service icon and notification to be displayed <strong>always</strong>.  Defaults to <code>false</code>.</p>
						</div>
						<p>The default behaviour is for the notification to be shown only while the SDK detects the device to be <em>moving</em>.  Some developers desire to provide full-disclosure to their users when the SDK has been enabled.</p>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="strings" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> strings</h3>
					<div class="tsd-signature tsd-kind-icon">strings<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Object</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Custom strings to render into <code>&lt;TextView /&gt;</code> elements of a custom notification <a href="notification.html#layout">layout</a>.</p>
						</div>
						<p>ℹ️ See <a href="https://github.com/transistorsoft/react-native-background-geolocation/wiki/Android-Custom-Notification-Layout">Android Custom Notification Layout</a> for setup instructions.</p>
						<p>You can declare your own custom <code>&lt;TextView /&gt;</code> elements and render data into them using the <code>notification.strings</code> parameter.</p>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-xml"><span style="color: #F8F8F2">&lt;</span><span style="color: #F92672">TextView</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:id</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;@+id/myCustomElement&quot;</span><span style="color: #F8F8F2">  // &lt;-- myCustomElement</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_width</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;match_parent&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:layout_height</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;wrap_content&quot;</span>
<span style="color: #F8F8F2">    </span><span style="color: #A6E22E">android:text</span><span style="color: #F8F8F2">=</span><span style="color: #E6DB74">&quot;notificationTitle&quot;</span><span style="color: #F8F8F2"> /&gt;</span>
</code></pre>
								<p>You can provide data to your custom elements using the <a href="notification.html#strings">strings</a> configuration parameter:</p>
							</dd>
							<dt class="tsd-comment-tag-example">example</dt>
							<dd><pre><code class="language-typescript"><span style="color: #F8F8F2">BackgroundGeolocation.</span><span style="color: #A6E22E">ready</span><span style="color: #F8F8F2">({</span>
<span style="color: #F8F8F2">  notification: {</span>
<span style="color: #F8F8F2">    strings: {</span>
<span style="color: #F8F8F2">      myCustomElement: </span><span style="color: #E6DB74">&quot;My Custom Element Text&quot;</span>
<span style="color: #F8F8F2">    }</span>
<span style="color: #F8F8F2">  }</span>
<span style="color: #F8F8F2">});</span>
</code></pre>
							</dd>
						</dl>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="text" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> text</h3>
					<div class="tsd-signature tsd-kind-icon">text<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Configure the <em>text</em> of the persistent notification in the Notification Bar when running with <a href="config.html#foregroundservice">Config.foregroundService</a> <strong><code>true</code></strong></p>
						</div>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-break">break</dt>
							<dd><p>Defaults to <em>&quot;Location service activated&quot;</em>.  When running the service with <a href="config.html#foregroundservice">Config.foregroundService</a>: true, Android requires a persistent notification.  This will configure the <strong>text</strong> of that notification.</p>
							</dd>
						</dl>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
					<a name="title" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> title</h3>
					<div class="tsd-signature tsd-kind-icon">title<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Configure the <em>title</em> of the persistent notification in the Notification Bar when running with <a href="config.html#foregroundservice">Config.foregroundService</a> <strong><code>true</code></strong></p>
						</div>
						<dl class="tsd-comment-tags">
							<dt class="tsd-comment-tag-break">break</dt>
							<dd><p>Defaults to the application name from <code>AndroidManifest</code>.  When running the service with <a href="config.html#foregroundservice">foregroundService</a>: true, Android requires a persistent notification.  This will configure the <strong>title</strong> of that notification.</p>
							</dd>
						</dl>
					</div>
				</section>
			</section>
		</div>
		<div class="col-3 col-menu menu-sticky-wrap menu-highlight">
			<nav class="tsd-navigation primary menu-sticky">
				<ul class="before-current">
				</ul>
				<ul class="current">
					<li class="current tsd-kind-interface">
						<a href="notification.html" class="tsd-kind-icon">Notification</a>
						<ul>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#actions" class="tsd-kind-icon">actions</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#channelid" class="tsd-kind-icon">channel<wbr>Id</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#channelname" class="tsd-kind-icon">channel<wbr>Name</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#color" class="tsd-kind-icon">color</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#largeicon" class="tsd-kind-icon">large<wbr>Icon</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#layout" class="tsd-kind-icon">layout</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#priority" class="tsd-kind-icon">priority</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#smallicon" class="tsd-kind-icon">small<wbr>Icon</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#sticky" class="tsd-kind-icon">sticky</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#strings" class="tsd-kind-icon">strings</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#text" class="tsd-kind-icon">text</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#title" class="tsd-kind-icon">title</a>
							</li>
						</ul>
					</li>
				</ul>
				<ul class="after-current">
				</ul>
			</nav>
			<nav class="tsd-navigation secondary menu-sticky">
				<ul class="before-current">
				</ul>
				<ul class="current">
					<li class="current tsd-kind-interface">
						<a href="notification.html" class="tsd-kind-icon">Notification</a>
						<ul>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#actions" class="tsd-kind-icon">actions</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#channelid" class="tsd-kind-icon">channel<wbr>Id</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#channelname" class="tsd-kind-icon">channel<wbr>Name</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#color" class="tsd-kind-icon">color</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#largeicon" class="tsd-kind-icon">large<wbr>Icon</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#layout" class="tsd-kind-icon">layout</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#priority" class="tsd-kind-icon">priority</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#smallicon" class="tsd-kind-icon">small<wbr>Icon</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#sticky" class="tsd-kind-icon">sticky</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#strings" class="tsd-kind-icon">strings</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#text" class="tsd-kind-icon">text</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface">
								<a href="notification.html#title" class="tsd-kind-icon">title</a>
							</li>
						</ul>
					</li>
				</ul>
				<ul class="after-current">
				</ul>
			</nav>
		</div>
	</div>
</div>
<footer class="with-border-bottom">
	<div class="container">
		<h2>Legend</h2>
		<div class="tsd-legend-group">
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
			</ul>
		</div>
	</div>
</footer>
<div class="container tsd-generator">
	<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4NNZKTE395"></script>
<script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'G-4NNZKTE395');
    </script>
</body>
</html>